package com.niiwoo.civet.user.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Description: 授信模型相关
 * @Author:LiJian
 * @Date:2017/5/24
 */

public class CreditEnum {

    /** 授信额度类型 **/
    @Getter
    @AllArgsConstructor
    public enum CreditAmountType {
        SPEED_BORROW((byte) 1, "极速借"),
        CREDIT_BORROW((byte) 2, "信用借"),
        GUARANTEE((byte) 3, "担保"),
        CARD_NIU((byte) 4, "卡牛");
        private Byte type;
        private String desc;
    }

    /** 授信调用者 **/
    @Getter
    @AllArgsConstructor
    public enum CreditAmountCaller {
        NOT_CALLER((byte) 0, "无调用"),
        APP((byte) 1, "前端调用"),
        BACKSTAGE((byte) 2, "后台调用"),
        H5((byte) 3, "H5调用"),
        WEIXIN((byte) 4, "微信调用"),
        RONG360((byte) 5, "融360调用"),
        CARDNIU((byte) 6, "卡牛");
        private Byte type;
        private String desc;
    }

    /** 授信结果 **/
    @Getter
    @AllArgsConstructor
    public enum CreditStatus {
        UNVERIFIED((byte) 0, "未验证"),
        CALLBACKING((byte) 1, "授信回调中"),
        SUCCESS((byte) 2, "成功"),
        FAIL((byte) 3, "失败");
        private Byte type;
        private String desc;
    }

    /** 授信反欺诈结果 **/
    @Getter
    @AllArgsConstructor
    public enum AntiFraudStatus {
        UNVERIFIED((byte) 0, "未验证"),
        CALLBACKING((byte) 1, "授信回调中"),
        REVIEW((byte) 2, "人工审核"),
        ACCEPT((byte) 3, "通过"),
        REFUSE((byte) 4, "不通过"),
        FAIL((byte) 5, "失败");
        private Byte type;
        private String desc;
    }

    /** 授信是否需要更新 **/
    @Getter
    @AllArgsConstructor
    public enum NeedUpdateStatus {
        NO((byte) 0, "不需要"),
        YES((byte) 1, "需要");
        private Byte type;
        private String desc;
    }

    /** 极速借授信模型类型 **/
    @Getter
    @AllArgsConstructor
    public enum CreditModelType {
        NO_MODEL((byte)0, "未知"),
        SOCIAL_SECURITY((byte) 1, "社保"),
        ZHIMA((byte) 2, "芝麻"),
        EDUCATION((byte) 3, "学历"),
        RONG360((byte) 4, "融360"),
        FREE_QUALIFICATION((byte) 5, "自有资质"),
        RONG360_FREE_QUALIFICATION((byte) 6, "融360自有资质"),
        CREDIT_CARD((byte) 7, "信用卡");

        private Byte type;
        private String desc;


        public static CreditModelType enumof(Byte type){
            for (CreditModelType creditModelType : values()) {
                if (creditModelType.type.equals( type )) {
                    return creditModelType;
                }
            }
            return null;
        }
    }

}
